/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-03-31
 * Time: 21:46
 */
import java.util.*;
import org.omg.CosNaming.NamingContextExtPackage.AddressHelper;
public class Bank {
    public static String bankName="中国工商银行";
    private Map<Integer,Accout> accountList;
    public void Add(Accout a) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入户名");
        String name=scanner.nextLine();
        System.out.println("请输入账号");
        int accout=scanner.nextInt();
        System.out.println("请输入密码");
        String password=scanner.nextLine();
        System.out.println("请输入存款");
        double balance=scanner.nextDouble();

    }
    public void remove(Integer k) {
       k=null;
    }
    public void login(Accout a,String p) throws BankingOperationException {
        if(a==null)
            throw new BankingOperationException("账户不存在");
        else {
            int m=3;
            Scanner scanner=new Scanner(System.in);

            while(m!=0){
                System.out.println("请输入密码");
                String password=scanner.nextLine();
                if(password.equals(p)) {
                    System.out.println("登录成功");
                    return ;
                }
                else{
                    m--;
                    throw new BankingOperationException("密码错误");
                }
            }
            throw new BankingOperationException("输入超三次，登录失败");
        }
    }
    public void logout() {

    }
}
